<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var time = Math.random() * 900000;
    console.log(Math.ceil(time));

    //var time = 705060;

    var day = Math.floor(time / 86400);
    var a = "天";
    console.log(day);

    //var hour = Math.floor((705060 - day * 86400) / 3600);
    var hour = Math.floor((time % 86400) / 3600);
    var b = "时";
    console.log(hour);

    //var minu = Math.floor((705060 - day * 86400- 3600 * hour) / 60);
    var minu = Math.floor(((time % 86400) % 3600 ) / 60);
    var c = "分";
    console.log(minu);

    //var miao = (705060-day * 86400 - 3600 * hour -60 *minu);
    var miao = Math.floor(((time % 86400) % 3600 ) % 60) ;
    var d = "秒";
    console.log(miao);

    var result = day + a + hour + b + minu + c + miao + d;
    console.log(result);
</script>
</html>